package oj.swing.component;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import javax.swing.JPanel;

import com.intelap.dx.dataset.DataSet;

import oj.jboss.seContext.SContext;

public abstract class OjSwingPanel extends JPanel implements ActionListener,
		ItemListener {

	private String sUser;

	private String sPassword;

	private String sIdUser;

	private JPanel tab;

	private String nameTable;

	private SContext context;

	private DataSet dataset;

	public OjSwingPanel() throws Exception {

		this.setLayout(null);
		setTab(this);
		setContext(new SContext());

	}

	public JPanel getTab() {
		return tab;
	}

	public void setTab(JPanel tab) {
		this.tab = tab;
	}

	public void actionPerformed(ActionEvent e) {

		eventAccionBoton(e.getActionCommand());
	}

	public abstract void eventAccionBoton(String boton);

	public String getSUser() {
		return sUser;
	}

	public void setSUser(String user) {
		sUser = user;
	}

	public String getSPassword() {
		return sPassword;
	}

	public void setSPassword(String password) {
		sPassword = password;
	}

	public String getSIdUser() {
		return sIdUser;
	}

	public void setSIdUser(String idUser) {
		sIdUser = idUser;
	}

	/**
	 * @return Returns the nameTable.
	 */
	public String getNameTable() {
		return nameTable;
	}

	/**
	 * @param nameTable
	 *            The nameTable to set.
	 */
	public void setNameTable(String nameTable) {
		this.nameTable = nameTable;
	}

	public SContext getContext() {
		return context;
	}

	public void setContext(SContext context) {
		this.context = context;
	}

	public DataSet getDataset() {
		return dataset;
	}

	public void setDataset(DataSet dataset) {
		this.dataset = dataset;
	}

}
